package de.hsb.ai.util;

import java.util.Properties;

@SuppressWarnings("serial")
public class ScotlandJadeConfig extends Properties {
	
	private static final String KEY_GAME = "game";
	private static final String KEY_GAME_LOGGING 	= KEY_GAME + ".logging.enabled";
	private static final String KEY_GAME_RUNS 	 	= KEY_GAME + ".runs";
	private static final String KEY_ON_MOVE_TIMEOUT 	= KEY_GAME + ".timeout.event.move";
	private static final String KEY_ON_START_TIMEOUT 	= KEY_GAME + ".timeout.event.start";

	/**
	 * Checks if {@value #KEY_GAME_LOGGING} is enabled.
	 * @return {@code true} if logging is enabled, {@code false} otherwise
	 */
	public boolean isGameLoggingEnabled() {
		return Boolean.parseBoolean(getProperty(KEY_GAME_LOGGING, "false"));
	}

	/**
	 * Returns the value stored in {@value #KEY_GAME_RUNS}.
	 * @return the number of runs, defaults to 1
	 */
	public int getRuns() {
		return Integer.parseInt(getProperty(KEY_GAME_RUNS, "1"));
	}

	public long getMoveEventTimeout() {
		return Long.parseLong(getProperty(KEY_ON_MOVE_TIMEOUT, "0"));
	}
	
	public long getStartEventTimeout() {
		return Long.parseLong(getProperty(KEY_ON_START_TIMEOUT, "0"));
	}
	
}
